<template>
  <div class="toupiaoguanli">
    <div class="common-layout">
      <el-container>
        <!-- 头部 -->
        <el-header class="header">
          <!-- header2 -->
          <div class="header2">
            <div class="demo-date-picker">
              <div class="block">
                发布日期：
                <el-date-picker
                  v-model="value"
                  type="daterange"
                  start-placeholder="2023-1-1"
                  end-placeholder="2023-10-1"
                  :default-time="defaultTime"
                  size="small"
                />
              </div>
            </div>
          </div>
          <!-- header3 -->
          <div class="header3">
            <el-form>
              状态：
              <!-- 下拉选择 -->
              <el-select
                v-model="value"
                class="m-2"
                placeholder="请选择"
                size="small"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form>
          </div>
          <!-- header4 -->
          <div class="header4">
            快速搜索：
            <el-input
              class="m-2"
              v-model="input"
              placeholder="请标题或者发布者"
            />
          </div>
          <div class="header5">
            <el-button type="primary" class="btn">查询</el-button>
          </div>
          <div class="header6">
            <el-button class="btn">重置</el-button>
          </div>
        </el-header>
        <!-- 中间部分 -->
        <el-main class="main">
          <div class="main-top">
            <el-button type="primary" class="fabu">发起投票</el-button>
          </div>
          <div class="main-middle">
            <!-- 表格 -->
            <el-table
              :cell-style="{ textAlign: 'center' }"
              :header-cell-style="{ 'text-align': 'center' }"
              stripe="ture"
              :data="tableData"
              border="true"
              size="small"
              style="width: 95%"
            >
              <el-table-column prop="id" label="序号" width="60" />
              <el-table-column prop="title" label="标题" width="350" />
              <el-table-column prop="check" label="状态" width="70" />
              <el-table-column prop="type" label="发送范围" width="400" />
              <el-table-column prop="content" label="参与对象" />
              <el-table-column prop="order" label="发布者" width="60" />
              <el-table-column prop="time" label="发送时间" width="150" />
              <el-table-column prop="active" label="操作" width="100">
                <template #default="scope">
                  <el-button class="caozuo" type="danger">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-main>
      </el-container>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
const value = ref("");
const input = ref("");

const defaultTime = ref<[Date, Date]>([
  new Date(2000, 1, 1, 0, 0, 0),
  new Date(2000, 2, 1, 23, 59, 59),
]);
const options = [
  {
    value: "Option1",
    label: "未开始",
  },
  {
    value: "Option2",
    label: "进行中",
  },
  {
    value: "Option3",
    label: "已结束",
  },
];

const tableData = [
  {
    id: "1",
    title: "",
    check: "进行中",
    type: "",
    order: "杨老师",
    content: "学生",
    time: "2022-12-05  15:27",
    active: "删除",
  },
  {
    id: "2",
    title: "",
    check: "进行中",
    type: "",
    order: "杨老师",
    content: "学生",
    time: "2022-12-05  15:27",
    active: "删除",
  },
  {
    id: "3",
    title: "",
    check: "进行中",
    type: "",
    order: "杨老师",
    content: "学生",
    time: "2022-12-05  15:27",
    active: "删除",
  },
  {
    id: "4",
    title: "",
    check: "进行中",
    type: "",
    order: "杨老师",
    content: "学生",
    time: "2022-12-05  15:27",
    active: "删除",
  },
  {
    id: "5",
    title: "",
    check: "进行中",
    type: "",
    order: "杨老师",
    content: "学生",
    time: "2022-12-05  15:27",
    active: "删除",
  },
];
// 底部跳转页
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.toupiaoguanli {
  height: 100%;
}
.common-layout {
  background: #f5f2f2;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 10px;
}
.header {
  height: 100px;
  background: white;
  margin-bottom: 10px;
  line-height: 100px;
  display: flex;
  justify-content: space-around;
}
.main {
  flex: 1;
  background: white;
}
.header2,
.header3,
.header4 {
  font-size: 12px;
}
.m-2 {
  width: 120px;
}
/* .demo-date-picker {
  width: 50px;
} */
.inp {
  width: 30px;
}
.fabu {
  margin-left: 1150px;
  width: 80px;
}
.btn {
  width: 70px;
}
.main-top {
  margin-top: 20px;
}
.main-middle {
  margin-top: 20px;
  margin-left: 50px;
}
.caozuo {
  width: 40px;
  height: 25px;
  font-size: 12px;
}
.main-bottom {
  margin-top: 180px;
  margin-left: 700px;
  width: 600px;
  height: 60px;
  background: pink;
  line-height: 60px;
  display: flex;
}
.ye {
  width: 110px;
  /* background: palegreen; */
  display: flex;
  font-size: 12px;
  border: 1px solid grey;
}
.ye_left {
  width: 40px;
}
.ye_middle {
  flex: 1;
  background: rgb(30, 198, 149);
}
.ye_right {
  width: 40px;
}
.demo-pagination-block + .demo-pagination-block {
  margin-top: 10px;
}
.demo-pagination-block .demonstration {
  margin-bottom: 16px;
}
</style>